import request from '@/utils/request';

export async function getFsuList(params) {
  return request(`/api/su`, {
    params,
  });
}
export async function getCustomMessage(params) {
  return request(`/api/custom/all/`, { params });
}
export async function getAllFsuType(params) {
  return request(`/api/fsuType/all`);
}
export async function querySpData(params) {
  return request(`/api/sp/querySpData`, { params });
}
export async function queryDevice(params) {
  return request(`/api/device/queryDevice`, { params });
}
export async function customParams(params) {
  return request(`/api/custom/default`, { params });
}
export async function getLog(params) {
  return request(`/api/log`, { params });
}
export async function getFlowAll(params) {
  return request(`/api/flow/all`, { params });
}
export async function add(params) {
  return request(`/api/su`, { method: 'POST', data: params });
}
export async function command(params) {
  return request(`/api/command`, { method: 'POST', data: params });
}
export async function getEnabledProcess(params) {
  return request(`/api/deviceFlowStatus/query`, { params });
}
export async function deleteSu(params) {
  return request(`/api/su/${params.id}`, {
    method: 'DELETE',
  });
}
export async function commandHttpConnect(params) {
  return request(`/api/command/httpConnect`, {
    method: 'POST',
    data: params,
  });
}
export async function deviceAssociationProcess(params) {
  return request(`/api/deviceFlowStatus/setUp`, {
    method: 'POST',
    data: params,
  });
}
export async function deleteAlarmAPI(params) {
  return request(`/api/alarm/delete`, {
    method: 'POST',
    data: params,
  });
}
export async function startFlow(params) {
  return request(`/api/command/startFlow`, {
    method: 'POST',
    data: params,
  });
}
export async function updateInfo(params) {
  return request(`/api/su/updateInfo`, {
    method: 'POST',
    data: params,
  });
}
export async function queryAlarmsBySu(params) {
  return request(`/api/alarm/queryAlarmsBySu`, {
    params,
  });
}
export async function getWsAddr(params) {
  return request(`/api/wsAddr`, {
    params,
  });
}

export async function importConfig(params) {
  return request(`/api/su/importConfig`, {
    method: 'POST',
    data: params,
  });
}
